package view_service

import (
	"gin-vue-admin/global"
	"gin-vue-admin/model"
)

func GetUsers(phone string) (err error, users model.Users) {
	err = global.GVA_DB.Where("phone = ?", phone).Preload(`UserProject`).Preload("UserLevel").First(&users).Error
	return
}

func UserLogin(phone,password string) (err error, users model.Users) {
	err = global.GVA_DB.Where("phone = ? and password = ?", phone,password).Preload(`UserProject`).Preload("UserLevel").First(&users).Error
	return
}

